package com.feshfans.po;

import javafx.event.EventHandler;
import javafx.stage.WindowEvent;

/**
 * 窗口构建时需要的数据载体
 * @param <T>
 */
public class ControllerEntity<T>  {
    /**
     * fxml 文件路径，绝对路径
     */
    private String fxmlPath;
    /**
     * 窗口标题
     */
    private String title;
    private int width;
    private int height;
    // 窗口初始化完成后，调用 onLoad 函数时传递的数据
    private T t;
    // 其它的事件处理，同样。
    // 窗口关闭时的事件处理
    private EventHandler<WindowEvent> onCloseRequestEventHandler;

    public ControllerEntity(String fxmlPath,String title,int width,int height){
        this.fxmlPath = fxmlPath;
        this.title = title;
        this.width = width;
        this.height = height;
    }

    public String getFxmlPath() {
        return fxmlPath;
    }

    public void setFxmlPath(String fxmlPath) {
        this.fxmlPath = fxmlPath;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public int getWidth() {
        return width;
    }

    public void setWidth(int width) {
        this.width = width;
    }

    public int getHeight() {
        return height;
    }

    public void setHeight(int height) {
        this.height = height;
    }

    public T getT() {
        return t;
    }

    public void setT(T t) {
        this.t = t;
    }

    public EventHandler<WindowEvent> getOnCloseRequestEventHandler() {
        return onCloseRequestEventHandler;
    }

    public void setOnCloseRequestEventHandler(EventHandler<WindowEvent> onCloseRequestEventHandler) {
        this.onCloseRequestEventHandler = onCloseRequestEventHandler;
    }
}
